<template>
  <span @click="isDialogVisible = true">
    <ElBadge :value="size || ''" :max="99">
      <i class="header-btn-icon el-icon-message"></i>
    </ElBadge>
    <ElementDialog :visible.sync="isDialogVisible" title="消息" show-full-screen height="600px" width="80%">
      <SystemMessage @handleClose="isDialogVisible = false" />
    </ElementDialog>
  </span>
</template>

<script>
  import SystemMessage from './SystemMessage'
  import { mapGetters } from 'vuex'

  export default {
    name: 'TopSystemMessage',
    components: { SystemMessage },
    data() {
      return {
        isDialogVisible: false
      }
    },
    computed: {
      ...mapGetters('message', ['size'])
    }
  }
</script>
